import { defineStore } from 'pinia'
import { getSwipeList } from '@/request'
const useListStore = defineStore('listStore', {
    state: () => {
        return {
            list: [],
        }
    },
    actions: {
        async loadData() {
            const result = await getSwipeList()
            this.list = result.data.data // 没做错误处理。
        }
    },
    getters: {
        filterList() {
            return (amount) => {
                return this.list.slice(0, amount)
            }
        }
    }
})

export default useListStore
